package com.dong.executor;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @Description: TODO
 * @Auther: dongwq
 * @Date: 2021/5/7 17:14
 * @company：
 */
public class ExecutorApplication {
    public static void main(String[] args) {

        ExecutorService executorService = Executors.newFixedThreadPool(6);
        try {
            executorService.submit(new PlayTask());
            executorService.submit(new SayTask());
        } finally {
            executorService.shutdown();
        }

    }
}

class PlayTask implements Runnable {


    public void run() {
        System.out.println("play task is started!");
    }
}

class SayTask implements Runnable {

    public void run() {
        System.out.println("say task is started!");
    }
}